package cn.itcast.mq.helloworld;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * <h4>day01_1_springcloud_eureka</h4>
 * <p>fannou广播模式</p>
 *
 * @author : by wujianming
 * @date : 2021-11-24 19:49
 **/
@RunWith(SpringRunner.class)
@SpringBootTest
public class FanoutExchange {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void fanoutExchange() {
        //兔子模板发送到rabbit队列itcast.fanout中
        for (int i = 0; i < 10000; i++) {
            rabbitTemplate.convertAndSend("itcast.fanout","hello,fanout");

        }
    }


}
